﻿using System.Windows.Controls;
using System.Xml.Linq;
using System.Windows.Data;
using  Acando.Dynamics.CRM.Silverlight.Library.Converter;
using Acando.Dynamics.CRM.Silverlight.Library.Interfaces;

namespace Acando.Dynamics.CRM.Silverlight.Library.Controls.FieldControls
{
    public partial class CrmBoolControl : BaseValueControl
    {
        public CrmBoolControl(IRecordControl recordControl, string controlType, string fieldName)
            : base(recordControl, controlType, fieldName)
        {
            InitializeComponent();
            this.chkValue.SetBinding(CheckBox.IsCheckedProperty, this.GetBinding(recordControl,controlType,fieldName));

            this.chkValue.IsEnabled = !recordControl.IsReadOnly;
        }
    }
}
